"""
ajax的get请求
"""

import urllib.request


url = "https://movie.douban.com/subject/35797709/?tag=%E7%83%AD%E9%97%A8&from=gaia"

headers = {
    "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36 Edg/113.0.1774.50"
}

request = urllib.request.Request(url=url, headers=headers)

response = urllib.request.urlopen(request)

content = response.read().decode("utf-8")

with open("douban.json", "w", encoding="utf-8") as f:
    f.write(content)
